var util = require('../../utils/util.js');
var api = require('../../utils/api.js'); 
var app = getApp();

Page({
  data: { 
    lastId: 0, //最后一条数据的id 
    hasMore: true,// 判断 数据是否全部加载完
    isLodingLock: true, //锁 防止数据加载  
    pageList: ['', '', '', '', '',], //
  },
  onLoad: function (options) {

  },
  onReachBottom() { //滑动到底部触发
    this.loadingMore()
  },
  // 加载更多
  loadingMore: function () {
    if (this.data.isLodingLock) {
      this.setData({
        isLodingLock: false
      })
      this.getPagServer()
    }
  },
  // 加载更多
  getPagServer: function (lastId) { //分页  
    var params = { 
      lastId: lastId == 0 ? 0 : this.data.lastId
    }
    util.getPageList(api, this, api.API_GETRECORDLIST, params, lastId)
  }, 
})